//	Company:	HTHK
//	NAME:	    ProjectCaegory.java
//	TITLE:	    The maintence of Project Category in Time Sheet System
//	FUNCTION:	The class ProjectCategory associate with the table
//	BY:	        Kodak Xu
//	DATE:	    09/12/2003
//	Update_by	Poly Li
//	Update_date	16-01-2004
//	Update_comments	alter table
// --------------------------------------------------------------
// MODIFICATION HISTORY
// --------------------------------------------------------------
//	CR Log #:  99999  BY:  XXXX   DATE:  dd/mm/yyyy
//	ERROR:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//	FIX:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// --------------------------------------------------------------
package tss.projectcategory;

import com.ffpc.sql.*;

import tss.projectcategory.ProjectCategoryBean;

public class ProjectCategory
   extends DataObject
   implements ProjectCategoryBean
{
   private String project_category_name = null;
   private String company_code = null;
   //Modify by Poly Li
   private String comments = null;
   private String create_date = null;
   private String create_by = null;
   private String upd_date = null;
   private String upd_by = null;
   private Column ColProjectCategoryName = null;
   private Column ColCompanyCode = null;
   //Modify by Poly Li
   private Column ColComments = null;
   private Column ColCreateDate = null;
   private Column ColCreateBy = null;
   private Column ColUpdDate = null;
   private Column ColUpdBy = null;
   /**
    * Constructor
    */
   public ProjectCategory()
   {
       ColProjectCategoryName = new Column(0,"project_category_name",Column.Types.string,null,20,false);
       ColCompanyCode = new Column(1,"company_code",Column.Types.string,null,10,false);
       //Modify by Poly Li
       ColComments = new Column(5,"comments",Column.Types.string,null,255,true);
       ColCreateDate = new Column(6,"create_date",Column.Types.time,null,7,false);
       ColCreateBy = new Column(7,"create_by",Column.Types.string,null,10,false);
       ColUpdDate = new Column(8,"upd_date",Column.Types.time,null,7,true);
       ColUpdBy = new Column(9,"upd_by",Column.Types.string,null,10,true);  // modify by Frankh 2009-04-02
   }

   // functions belongs to ProjectCategoryBean interface

   @Override
public void setProject_category_name(String project_category_name)
   {       this.project_category_name = this.setAttribute(ColProjectCategoryName,project_category_name);
   }

   @Override
public String getProject_category_name()
   {       return this.project_category_name==null?"":this.project_category_name;
   }

   @Override
public void setCompany_code(String company_code)
   {       this.company_code = this.setAttribute(ColCompanyCode,company_code);
   }

   @Override
public String getCompany_code()
   {       return this.company_code==null?"":this.company_code;
   }

	//Modify by Poly Li
   @Override
public void setComments(String comments)
   {       this.comments = this.setAttribute(ColComments,comments);
   }

   @Override
public String getComments()
   {       return this.comments==null?"":this.comments;
   }

   @Override
public void setCreate_date(String create_date)
   {       this.create_date = this.setAttribute(ColCreateDate,create_date);
   }

   @Override
public String getCreate_date()
   {       return this.create_date==null?"":this.create_date;
   }

   @Override
public void setCreate_by(String create_by)
   {       this.create_by = this.setAttribute(ColCreateBy,create_by);
   }

   @Override
public String getCreate_by()
   {       return this.create_by==null?"":this.create_by;
   }

   @Override
public void setUpd_date(String upd_date)
   {       this.upd_date = this.setAttribute(ColUpdDate,upd_date);
   }

   @Override
public String getUpd_date()
   {       return this.upd_date==null?"":this.upd_date;
   }

   @Override
public void setUpd_by(String upd_by)
   {       this.upd_by = this.setAttribute(ColUpdBy,upd_by);
   }

   @Override
public String getUpd_by()
   {       return this.upd_by==null?"":this.upd_by;
   }

   // belongs to row interface

   @Override
public Column[] createColumns()
   {
       Column[] cols = new Column[7];
       cols[0] = ColProjectCategoryName.clone(null);
       cols[1] = ColCompanyCode.clone(null);
       //Modify by Poly Li
       cols[2] = ColComments.clone(null);
       cols[3] = ColCreateDate.clone(null);
       cols[4] = ColCreateBy.clone(null);
       cols[5] = ColUpdDate.clone(null);
       cols[6] = ColUpdBy.clone(null);
       return cols;
   }

   // super's abstract methods

   @Override
public String getTableName()
   {
       return "tss.tss_c_project_category";
   }

   @Override
protected String[] getKeyColumnNames()
   {
       String[] list = {
                         "project_category_name"
                       };
       return list;
   }

   @Override
protected String[] getUpdatableColumnNames()
   {
       String[] list = {
                         "company_code"
                         //Modify by Poly Li
                         ,"comments"
                         ,"create_date"
                         ,"create_by"
                         ,"upd_date"
                         ,"upd_by"
                       };
       return list;
   }

   @Override
protected void retrieveColumnValues()
   {
       this.project_category_name = this.retrieveColumnValue("project_category_name");
       this.company_code = this.retrieveColumnValue("company_code");
       //Modify by Poly Li
       this.comments = this.retrieveColumnValue("comments");
       this.create_date = this.retrieveColumnValue("create_date");
       this.create_by = this.retrieveColumnValue("create_by");
       this.upd_date = this.retrieveColumnValue("upd_date");
       this.upd_by = this.retrieveColumnValue("upd_by");
   }
}

